#ifndef CCANVAS_H
#define CCANVAS_H

#include <wx/scrolwin.h>
#include <wx/dcclient.h>
#include "CAbacus.h"
#define DIGITAL_INTERVAL 100
#define STONE_WIDTH 80
#define STONE_HEIGHT 40
#define FRAME_THICKNESS 40
#define BEAM_THICKNESS 40
#define STICK_DIAMETER 20
#define LEFT_X 50
#define TOP_Y 80
#define FONT_SIZE 40

class CCanvas : public wxScrolledWindow
{
    public:
        CCanvas(wxWindow *lpParentFrame);
        wxBrush lpbr[7];

    protected:
        void OnSize(wxSizeEvent &event);
        void OnPaint(wxPaintEvent &event);
        void OnLeftButtonUp(wxMouseEvent &event);
        void OnKeyUp(wxKeyEvent &event);
        CAbacus abacus;
        int frame_width, beam_top, down_frame_top, stick_top, stick_left, stick_height, up_stone_top, down_stone_top, stone_left, text_x, text_y;

    private:
        void DrawFramesAndBeam(wxPaintDC &dc);
        void DrawSticks(wxPaintDC &dc);
        void DrawStones(wxPaintDC &dc);
        void DrawNumber(wxPaintDC &dc);
        DECLARE_EVENT_TABLE()
};

#endif // CCANVAS_H
